//
//  UIFont+Extension.m
//  AmountBody
//
//  Created by Qiu Jishuai on 2018/1/25.
//  Copyright © 2018年 RCMTM. All rights reserved.
//

#import "UIFont+Extension.h"

@implementation UIFont (Extension)
+ (instancetype)systemFontWithWeightType: (SystemFontWeightType)weightType size: (CGFloat)size {
    switch (weightType) {
        case SystemFontWeightTypeMedium:
            if (@available(iOS 9.0, *)) {
                return [UIFont fontWithName:@"PingFangSC-Medium" size:size];
            } else {
                return [UIFont fontWithName:@"HelveticaNeue-Medium" size:size];
            }
        default:
            return [UIFont systemFontOfSize:size];
        }
}
+ (instancetype)systemMediumFontWithSize: (CGFloat)size {
    return [self systemFontWithWeightType:SystemFontWeightTypeMedium size:size];
}
+ (instancetype)systemRegularFontWithSize: (CGFloat)size {
    return [self systemFontWithWeightType:SystemFontWeightTypeRegular size:size];
}
@end
